package com.minimalist.common.entity.lindi.vo.purchasetownindex;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.entity.basic.vo.file.FileVO;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 林地指标交易平台_镇街购买指标 VO类
 *
 * @author 11987
 */
@Schema(name = "林地指标交易平台_镇街购买指标实体")
public class LindiPurchaseTownIndexVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "镇街购买指标ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "purchaseTownIndexId", description = "镇街购买指标ID", type = "string")
    private Long purchaseTownIndexId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "purchaseIndexRecordId", description = "购买指标记录ID", type = "string")
    private Long purchaseIndexRecordId;

    @Schema(name = "townName", description = "镇街名称", type = "string")
    private String townName;

    @Schema(name = "townIndex", description = "购买亩数", type = "string")
    private String townIndex;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "fileId", description = "文件ID", type = "string")
    private Long fileId;

    @Schema(name = "file", description = "文件信息")
    private FileVO file;

    public LindiPurchaseTownIndexVO() {
    }

    public LindiPurchaseTownIndexVO(Long purchaseTownIndexId, Long purchaseIndexRecordId, String townName, String townIndex, Long fileId, FileVO file) {
        this.purchaseTownIndexId = purchaseTownIndexId;
        this.purchaseIndexRecordId = purchaseIndexRecordId;
        this.townName = townName;
        this.townIndex = townIndex;
        this.fileId = fileId;
        this.file = file;
    }

    public Long getPurchaseTownIndexId() {
        return purchaseTownIndexId;
    }

    public void setPurchaseTownIndexId(Long purchaseTownIndexId) {
        this.purchaseTownIndexId = purchaseTownIndexId;
    }

    public Long getPurchaseIndexRecordId() {
        return purchaseIndexRecordId;
    }

    public void setPurchaseIndexRecordId(Long purchaseIndexRecordId) {
        this.purchaseIndexRecordId = purchaseIndexRecordId;
    }

    public String getTownName() {
        return townName;
    }

    public void setTownName(String townName) {
        this.townName = townName;
    }

    public String getTownIndex() {
        return townIndex;
    }

    public void setTownIndex(String townIndex) {
        this.townIndex = townIndex;
    }

    public Long getFileId() {
        return fileId;
    }

    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }

    public FileVO getFile() {
        return file;
    }

    public void setFile(FileVO file) {
        this.file = file;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LindiPurchaseTownIndexVO that = (LindiPurchaseTownIndexVO) o;
        return Objects.equals(purchaseTownIndexId, that.purchaseTownIndexId) &&
                Objects.equals(purchaseIndexRecordId, that.purchaseIndexRecordId) &&
                Objects.equals(townName, that.townName) &&
                Objects.equals(townIndex, that.townIndex) &&
                Objects.equals(fileId, that.fileId) &&
                Objects.equals(file, that.file);
    }

    @Override
    public int hashCode() {
        return Objects.hash(purchaseTownIndexId, purchaseIndexRecordId, townName, townIndex, fileId, file);
    }

    @Override
    public String toString() {
        return "LindiPurchaseTownIndexVO{" +
                "purchaseTownIndexId=" + purchaseTownIndexId +
                ", purchaseIndexRecordId=" + purchaseIndexRecordId +
                ", townName='" + townName + '\'' +
                ", townIndex='" + townIndex + '\'' +
                ", fileId=" + fileId +
                ", file=" + file +
                '}';
    }
}